
package org.ly.uap.client.ssl;

import java.util.regex.Pattern;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;

public class RegexHostnameVerifier
        implements HostnameVerifier {
    private Pattern pattern;

    public RegexHostnameVerifier(String regex) {
        this.pattern = Pattern.compile(regex);
    }

    public boolean verify(String hostname, SSLSession session) {
        return this.pattern.matcher(hostname).matches();
    }
}




